import axios from 'poros/http';

// const BASE_API = 'http://10.110.100.171:8030';
const BASE_API = '';

//价格首页tableList接口/
export const postPriceList = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/listByPage`,
    method: 'post',
    data,
  });

//价格首页tableList导出接口
export const postExportList = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/export`,
    method: 'post',
    responseType: 'arraybuffer',
    hasInterceptors: true,
    data,
  });

// 删除价格变更
export const postDeletePriceChange = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/delete`,
    method: 'post',
    data,
  });

//价格变更
export const getPriceDetail = params =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/queryDetail/`,
    method: 'get',
    params,
  });

// 查询价格变更明细tableList
export const postPriceChangeTableList = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/getPriceChangeMforecastDetailList`,
    method: 'post',
    data,
  });

// 价格发起变更
export const postStartPriceChange = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/launchPriceChange`,
    method: 'post',
    data,
  });

// 价格发起变更审批
export const postPriceChangeApprove = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/priceChangeApprove`,
    method: 'post',
    data,
  });

// 转他人处理接口
export const postReuseDetail = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/forward`,
    method: 'post',
    data,
  });

//价格变更导出接口
export const postExport = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/export/priceChangeDetail`,
    method: 'post',
    responseType: 'arraybuffer',
    hasInterceptors: true,
    data,
  });

//价格台账详情接口
export const postPriceParameterList = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/getPriceParameterList`,
    method: 'post',
    data,
  });

//价格台账导出接口
export const postExportPriceParameterDetail = data =>
  axios({
    url: `${BASE_API}/api/salesforecast-service/price/export/priceParameterDetail`,
    method: 'post',
    responseType: 'arraybuffer',
    hasInterceptors: true,
    data,
  });
